﻿@model IEnumerable<YogaStudio.Data.Domain.Section>

@{
    ViewBag.Title = "Index";
}


<div class="main">
    <div class="content">
        <div class="section group">
            <div class="col span_2_of_3">
                <div class="contact-form">
                    @{
                        
                        if (TempData["Error"] != null)
                        {
                            <h1 style="color: red"> @TempData["Error"] &nbsp;@if (@TempData["Waiver"] != null)
                                                                      {@Html.ActionLink("Click Here", "RequestWaiver", "WaiverRequest")}</h1>
                        }
                    }
                </div>

                <div class="contact-form">
                    @using (Html.BeginForm())
                    {
                        @Html.AntiForgeryToken()


                        <div class="form-horizontal">
                            <h5>
                                Search:@Html.TextBox("keyword")
                                <input type="submit" value="Search" />
                            </h5>

                        </div>
                    }
                    <h3>Section List</h3>
                   
                    <div class="datagrid">
                        <table id="box-table-a">
                            <tr>
                                <th>
                                    @Html.DisplayNameFor(model => model.Course.CourseName)
                                </th>
                                <th>
                                    @Html.DisplayNameFor(model => model.Faculty.FullName)
                                </th>
                                <th>
                                    @Html.DisplayNameFor(model => model.Room.RoomNo)
                                </th>
                                <th>
                                    @Html.DisplayNameFor(model => model.Schedule.FromDate)
                                </th>
                                <th>
                                    @Html.DisplayNameFor(model => model.Schedule.ToDate)
                                </th>
                                <th>
                                    @Html.DisplayNameFor(model => model.Price)
                                </th>
                                <th></th>
                            </tr>

                            @foreach (var item in Model)
                            {
                                <tr>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.Course.CourseName)
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.Faculty.FullName)
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.Room.RoomNo)
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.Schedule.FromDate.Date)
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.Schedule.ToDate.Date)
                                    </td>
                                    <td>
                                        @Html.DisplayFor(modelItem => item.Price)
                                    </td>
                                    <td>
                                        @Html.ActionLink("Register", "Register", new { id = item.Id }) |
                                        @Html.ActionLink("Details", "CustomerDetails", new { id = item.Id }) 
                                    </td>
                                </tr>
                            }

                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

